﻿<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero" x:Class="ActiveStoryTouch.UI.App"
            xmlns:enums="clr-namespace:ActiveStoryTouch.UI.Enums"
             StartupUri="MainWindow.xaml"
			 mc:Ignorable="d">
    <Application.Resources>
        <enums:PenModeHelper x:Key="PenModeConverter"/>

        <Color x:Key="BabyBlueBackgroundColor">#FFE3ECF6</Color>
        <Color x:Key="ApplicationBackgroundColor">#FFBFCDDB</Color>
        <SolidColorBrush x:Key="BabyBlueBackgroundBrush" Color="{DynamicResource BabyBlueBackgroundColor}"></SolidColorBrush>
        <SolidColorBrush x:Key="ApplicationBackgroundBrush" Color="{DynamicResource ApplicationBackgroundColor}"></SolidColorBrush>
        <ItemsPanelTemplate x:Key="HorizontalListBoxItemsPanelTemplate">
            <VirtualizingStackPanel Orientation="Horizontal"  IsItemsHost="True"/>
        </ItemsPanelTemplate>
        <DataTemplate x:Key="PageListBoxDataTemplate">
            <Border BorderBrush="Black" BorderThickness="1" CornerRadius="4" MinWidth="65">
                <Border.Background>
                    <SolidColorBrush Color="{DynamicResource ApplicationBackgroundColor}"/>
                </Border.Background>
                <DockPanel LastChildFill="True">
                    <DockPanel.ToolTip>
                        <DockPanel LastChildFill="True">
                            <Border BorderBrush="Black" BorderThickness="0,0,0,1" DockPanel.Dock="Top" >
                                <TextBlock Text="{Binding Name}" HorizontalAlignment="Center" FontWeight="Bold"/>
                            </Border>
                            <Image DockPanel.Dock="Bottom" HorizontalAlignment="Center" Source="{Binding TempThumbnailPath}" Height="150" />
                        </DockPanel>
                    </DockPanel.ToolTip>
                    <TextBlock DockPanel.Dock="Top" Text="{Binding Name}" HorizontalAlignment="Center"/>
                    <!--ToolTip="{Binding Path=DisplayedLabel}"-->
                    <Image DockPanel.Dock="Bottom" HorizontalAlignment="Center" Source="Content/DummyThumb.png" Height="65" />
                    <!--ToolTip="{Binding Path=DisplayedLabel}" "{Binding TempThumbnailPath}"-->
                </DockPanel>
            </Border>
        </DataTemplate>
        <DataTemplate x:Key="LargePageListBoxDataTemplate">
            <Grid>
            <!--<Border BorderBrush="Black" BorderThickness="1" CornerRadius="4">
                <Border.Background>
                    <SolidColorBrush Color="{DynamicResource ApplicationBackgroundColor}"/>
                </Border.Background>-->
                <DockPanel LastChildFill="True">
                    <DockPanel.ToolTip>
                        <DockPanel LastChildFill="True">
                            <Border BorderBrush="Black" BorderThickness="0,0,0,1" DockPanel.Dock="Top" >
                                <TextBlock Text="{Binding Name}" HorizontalAlignment="Center" FontWeight="Bold"/>
                            </Border>
                            <Image DockPanel.Dock="Bottom" HorizontalAlignment="Center" Source="{Binding TempThumbnailPath}" Height="150" />
                        </DockPanel>
                    </DockPanel.ToolTip>
                    <TextBlock DockPanel.Dock="Top" Text="{Binding Name}"/>
                    <!--ToolTip="{Binding Path=DisplayedLabel}"-->
                    <Image DockPanel.Dock="Bottom"  Source="Content/DummyThumb.png" Stretch="Uniform" Height="200"/>
                    <!--ToolTip="{Binding Path=DisplayedLabel}"-->
                </DockPanel>
            <!--</Border>-->
            </Grid>
        </DataTemplate>
        <Style TargetType="{x:Type Button}" x:Key="ColorButton">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="5,5,5,5">
                            <Label HorizontalAlignment="Center" VerticalAlignment="Center" Content="{TemplateBinding Content}" Foreground="White"/>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        
        <Style TargetType="{x:Type Button}" x:Key="DialogButton">
            <Setter Property="Margin" Value="4">
            </Setter>
            <Setter Property="MinHeight" Value="30"></Setter>
            <Setter Property="MinWidth" Value="100"></Setter>
        </Style>

        <DataTemplate x:Key="ObjectsTreeViewDataTemplate">

            <TextBlock Text="{Binding Content}" HorizontalAlignment="Center"/>

        </DataTemplate>

        <Style x:Key="ButtonFocusVisual">
            <Setter Property="Control.Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Rectangle Margin="2" SnapsToDevicePixels="true" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <LinearGradientBrush x:Key="ButtonNormalBackground" EndPoint="0,1" StartPoint="0,0">
            <GradientStop Color="#F3F3F3" Offset="0"/>
            <GradientStop Color="#EBEBEB" Offset="0.5"/>
            <GradientStop Color="#DDDDDD" Offset="0.5"/>
            <GradientStop Color="#CDCDCD" Offset="1"/>
        </LinearGradientBrush>
        <SolidColorBrush x:Key="ButtonNormalBorder" Color="#FF707070"/>

        <Style x:Key="ToggleRadioButtonStyle" TargetType="{x:Type RadioButton}">

            <Setter Property="Background" Value="{StaticResource ButtonNormalBackground}"/>

            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
            <Setter Property="HorizontalContentAlignment" Value="Center"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="Padding" Value="1"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type RadioButton}">
                        <Microsoft_Windows_Themes:ButtonChrome x:Name="Chrome" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderPressed="{TemplateBinding IsPressed}" RenderDefaulted="{TemplateBinding Button.IsDefaulted}" SnapsToDevicePixels="true">
                            <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </Microsoft_Windows_Themes:ButtonChrome>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsKeyboardFocused" Value="true">
                                <Setter Property="RenderDefaulted" TargetName="Chrome" Value="true"/>
                            </Trigger>
                            <Trigger Property="IsChecked" Value="true">
                                <Setter Property="RenderPressed" TargetName="Chrome" Value="true"/>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter Property="Foreground" Value="#ADADAD"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>

            </Setter>
        </Style>


        <LinearGradientBrush x:Key="HorizontalSliderThumbHoverBackgroundInverted" EndPoint="0,0" StartPoint="0,1">
            <GradientStop Color="white" Offset="0"/>
            <GradientStop Color="#B8E2F9" Offset="0.5"/>
            <GradientStop Color="#B0DFF8" Offset="1"/>
        </LinearGradientBrush>
        <SolidColorBrush x:Key="HorizontalSliderThumbHoverBorder" Color="#3C7FB1"/>
        <LinearGradientBrush x:Key="HorizontalSliderThumbPressedBackgroundInverted" EndPoint="0,0" StartPoint="0,1">
            <GradientStop Color="#B8E4FA" Offset="0.25"/>
            <GradientStop Color="#5EB4E3" Offset="0.5"/>
            <GradientStop Color="#4C8BB4" Offset="1"/>
        </LinearGradientBrush>
        <SolidColorBrush x:Key="HorizontalSliderThumbPressedBorder" Color="#2C628B"/>
        <Geometry x:Key="SliderThumbDisabledGeometry">M -5,-10.5 L 5,-10.5 L 5,10.5 L -5,10.5 Z</Geometry>
        <Geometry x:Key="SliderPointedThumbDisabledGeometry">M 4.5,-8.5 L -4.5,-8.5 L -4.5,4.5 L -0.5,8.5 L 0.5,8.5 L 4.5,4.5 Z</Geometry>
        <Geometry x:Key="SliderPointedThumbOuterBorderGeometry">M 4.5,-7.5 A 1 1 0 0 0 3.5,-8.5 L -3.5,-8.5 A 1 1 0 0 0 -4.5,-7.5 L -4.5,4.5 L -0.5,8.5 L 0.5,8.5 L 4.5,4.5 Z</Geometry>
        <LinearGradientBrush x:Key="HorizontalSliderThumbNormalBackgroundInverted" EndPoint="0,0" StartPoint="0,1">
            <GradientStop Color="White" Offset="0"/>
            <GradientStop Color="#F0EFEF" Offset="0.4"/>
            <GradientStop Color="#D6D5D5" Offset=".8"/>
        </LinearGradientBrush>
        <Geometry x:Key="SliderPointedThumbMiddleBorderGeometry">M 3.5,-7.5 L -3.5,-7.5 L -3.5,4.5 L 0,8 L 3.5,4.5 Z</Geometry>
        <Style x:Key="HorizontalSliderUpThumbStyle" TargetType="{x:Type Thumb}">
            <Setter Property="Focusable" Value="false"/>
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Setter Property="Height" Value="18"/>
            <Setter Property="Width" Value="10"/>
            <Setter Property="Foreground" Value="Gray"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Thumb}">
                        <Canvas SnapsToDevicePixels="true">
                            <Canvas.RenderTransform>
                                <TransformGroup>
                                    <TransformGroup.Children>
                                        <TransformCollection>
                                            <RotateTransform Angle="180"/>
                                            <TranslateTransform X="5" Y="9"/>
                                        </TransformCollection>
                                    </TransformGroup.Children>
                                </TransformGroup>
                            </Canvas.RenderTransform>
                            <Path x:Name="Background" Data="{StaticResource SliderPointedThumbOuterBorderGeometry}" Fill="{StaticResource HorizontalSliderThumbNormalBackgroundInverted}"/>
                            <Path x:Name="InnerBorder" Data="{StaticResource SliderPointedThumbMiddleBorderGeometry}" Stroke="White" StrokeThickness="1"/>
                            <Path x:Name="OuterBorder" Data="{StaticResource SliderPointedThumbOuterBorderGeometry}" Stroke="#FF929292" StrokeThickness="1"/>
                        </Canvas>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="true">
                                <Setter Property="Fill" TargetName="Background" Value="{StaticResource HorizontalSliderThumbHoverBackgroundInverted}"/>
                                <Setter Property="Stroke" TargetName="OuterBorder" Value="{StaticResource HorizontalSliderThumbHoverBorder}"/>
                            </Trigger>
                            <Trigger Property="Foreground" Value="Blue">
                                <Setter Property="Fill" TargetName="Background" Value="{StaticResource HorizontalSliderThumbHoverBackgroundInverted}"/>
                                <Setter Property="Stroke" TargetName="OuterBorder" Value="{StaticResource HorizontalSliderThumbHoverBorder}"/>
                            </Trigger>
                            <Trigger Property="IsDragging" Value="true">
                                <Setter Property="Fill" TargetName="Background" Value="{StaticResource HorizontalSliderThumbPressedBackgroundInverted}"/>
                                <Setter Property="Stroke" TargetName="OuterBorder" Value="{StaticResource HorizontalSliderThumbPressedBorder}"/>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter Property="Fill" TargetName="Background" Value="#FFF4F4F4"/>
                                <Setter Property="Stroke" TargetName="InnerBorder" Value="{x:Null}"/>
                                <Setter Property="Data" TargetName="OuterBorder" Value="{StaticResource SliderThumbDisabledGeometry}"/>
                                <Setter Property="Stroke" TargetName="OuterBorder" Value="#FFAEB1AF"/>
                                <Setter Property="Data" TargetName="OuterBorder" Value="{StaticResource SliderPointedThumbDisabledGeometry}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <LinearGradientBrush x:Key="HorizontalSliderThumbHoverBackground" EndPoint="0,1" StartPoint="0,0">
            <GradientStop Color="white" Offset="0"/>
            <GradientStop Color="#B8E2F9" Offset="0.5"/>
            <GradientStop Color="#B0DFF8" Offset="1"/>
        </LinearGradientBrush>
        <LinearGradientBrush x:Key="HorizontalSliderThumbPressedBackground" EndPoint="0,1" StartPoint="0,0">
            <GradientStop Color="#B8E4FA" Offset="0.25"/>
            <GradientStop Color="#5EB4E3" Offset="0.5"/>
            <GradientStop Color="#4C8BB4" Offset="1"/>
        </LinearGradientBrush>
        <LinearGradientBrush x:Key="HorizontalSliderThumbNormalBackground" EndPoint="0,1" StartPoint="0,0">
            <GradientStop Color="White" Offset="0"/>
            <GradientStop Color="#F0EFEF" Offset="0.4"/>
            <GradientStop Color="#D6D5D5" Offset=".8"/>
        </LinearGradientBrush>
        <Style x:Key="HorizontalSliderDownThumbStyle" TargetType="{x:Type Thumb}">
            <Setter Property="Focusable" Value="false"/>
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Setter Property="Height" Value="18"/>
            <Setter Property="Width" Value="10"/>
            <Setter Property="Foreground" Value="Gray"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Thumb}">
                        <Canvas SnapsToDevicePixels="true">
                            <Canvas.RenderTransform>
                                <TranslateTransform X="5" Y="9"/>
                            </Canvas.RenderTransform>
                            <Path x:Name="Background" Data="{StaticResource SliderPointedThumbOuterBorderGeometry}" Fill="{StaticResource HorizontalSliderThumbNormalBackground}"/>
                            <Path x:Name="InnerBorder" Data="{StaticResource SliderPointedThumbMiddleBorderGeometry}" Stroke="White" StrokeThickness="1"/>
                            <Path x:Name="OuterBorder" Data="{StaticResource SliderPointedThumbOuterBorderGeometry}" Stroke="#FF929292" StrokeThickness="1"/>
                        </Canvas>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="true">
                                <Setter Property="Fill" TargetName="Background" Value="{StaticResource HorizontalSliderThumbHoverBackground}"/>
                                <Setter Property="Stroke" TargetName="OuterBorder" Value="{StaticResource HorizontalSliderThumbHoverBorder}"/>
                            </Trigger>
                            <Trigger Property="Foreground" Value="Blue">
                                <Setter Property="Fill" TargetName="Background" Value="{StaticResource HorizontalSliderThumbHoverBackground}"/>
                                <Setter Property="Stroke" TargetName="OuterBorder" Value="{StaticResource HorizontalSliderThumbHoverBorder}"/>
                            </Trigger>
                            <Trigger Property="IsDragging" Value="true">
                                <Setter Property="Fill" TargetName="Background" Value="{StaticResource HorizontalSliderThumbPressedBackground}"/>
                                <Setter Property="Stroke" TargetName="OuterBorder" Value="{StaticResource HorizontalSliderThumbPressedBorder}"/>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter Property="Fill" TargetName="Background" Value="#FFF4F4F4"/>
                                <Setter Property="Stroke" TargetName="InnerBorder" Value="{x:Null}"/>
                                <Setter Property="Data" TargetName="OuterBorder" Value="{StaticResource SliderThumbDisabledGeometry}"/>
                                <Setter Property="Stroke" TargetName="OuterBorder" Value="#FFAEB1AF"/>
                                <Setter Property="Data" TargetName="OuterBorder" Value="{StaticResource SliderPointedThumbDisabledGeometry}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <LinearGradientBrush x:Key="HorizontalSliderTrackNormalBorder" EndPoint="0,1" StartPoint="0,0">
            <GradientStop Color="#FFAEB1AF" Offset="0.1"/>
            <GradientStop Color="White" Offset=".9"/>
        </LinearGradientBrush>
        <SolidColorBrush x:Key="HorizontalSliderTrackNormalBackground" Color="#FFE7EAEA"/>
        <Style x:Key="SliderRepeatButtonStyle" TargetType="{x:Type RepeatButton}">
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Setter Property="IsTabStop" Value="false"/>
            <Setter Property="Focusable" Value="false"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type RepeatButton}">
                        <Rectangle Fill="Transparent"/>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Geometry x:Key="SliderThumbOuterBorderGeometry">M -5,-9.5 A 1 1 0 0 1 -4,-10.5 L 4,-10.5 A 1 1 0 0 1 5,-9.5 L 5,9.5 A 1 1 0 0 1 4,10.5 L -4,10.5 A 1 1 0 0 1 -5,9.5 Z</Geometry>
        <Geometry x:Key="SliderThumbMiddleBorderGeometry">M -4,-9.5 L 4,-9.5 L 4,9.5 L -4,9.5 Z</Geometry>
        <Style x:Key="HorizontalSliderThumbStyle" TargetType="{x:Type Thumb}">
            <Setter Property="Focusable" Value="false"/>
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Setter Property="Height" Value="22"/>
            <Setter Property="Width" Value="11"/>
            <Setter Property="Foreground" Value="Gray"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Thumb}">
                        <Canvas SnapsToDevicePixels="true">
                            <Canvas.RenderTransform>
                                <TransformGroup>
                                    <ScaleTransform ScaleX="0.7" ScaleY="0.7"></ScaleTransform>
                                    <TranslateTransform X="5.5" Y="11"/>
                                </TransformGroup>
                            </Canvas.RenderTransform>
                            <Path x:Name="Background" Data="{StaticResource SliderThumbOuterBorderGeometry}" Fill="#FFB2B2B2"/>
                            <Path x:Name="InnerBorder" Data="{StaticResource SliderThumbMiddleBorderGeometry}">
                                <Path.Stroke>
                                    <SolidColorBrush Color="#FFB2B2B2"/>
                                </Path.Stroke>
                            </Path>
                            <Path x:Name="OuterBorder" Data="{StaticResource SliderThumbOuterBorderGeometry}">
                                <Path.Stroke>
                                    <SolidColorBrush Color="#FFB2B2B2"/>
                                </Path.Stroke>
                            </Path>
                        </Canvas>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="true">
                                <Setter Property="Fill" TargetName="Background" Value="{StaticResource HorizontalSliderThumbHoverBackground}"/>
                                <Setter Property="Stroke" TargetName="OuterBorder" Value="{StaticResource HorizontalSliderThumbHoverBorder}"/>
                            </Trigger>
                            <Trigger Property="Foreground" Value="Blue">
                                <Setter Property="Fill" TargetName="Background" Value="{StaticResource HorizontalSliderThumbHoverBackground}"/>
                                <Setter Property="Stroke" TargetName="OuterBorder" Value="{StaticResource HorizontalSliderThumbHoverBorder}"/>
                            </Trigger>
                            <Trigger Property="IsDragging" Value="true">
                                <Setter Property="Fill" TargetName="Background" Value="{StaticResource HorizontalSliderThumbPressedBackground}"/>
                                <Setter Property="Stroke" TargetName="OuterBorder" Value="{StaticResource HorizontalSliderThumbPressedBorder}"/>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter Property="Fill" TargetName="Background" Value="#FFF4F4F4"/>
                                <Setter Property="Stroke" TargetName="InnerBorder" Value="{x:Null}"/>
                                <Setter Property="Data" TargetName="OuterBorder" Value="{StaticResource SliderThumbDisabledGeometry}"/>
                                <Setter Property="Stroke" TargetName="OuterBorder" Value="#FFAEB1AF"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <LinearGradientBrush x:Key="VerticalSliderThumbHoverBackground" EndPoint="1,0" StartPoint="0,0">
            <GradientStop Color="white" Offset="0"/>
            <GradientStop Color="#B8E2F9" Offset="0.5"/>
            <GradientStop Color="#B0DFF8" Offset="1"/>
        </LinearGradientBrush>
        <LinearGradientBrush x:Key="VerticalSliderThumbPressedBackground" EndPoint="1,0" StartPoint="0,0">
            <GradientStop Color="#B8E4FA" Offset="0.25"/>
            <GradientStop Color="#5EB4E3" Offset="0.5"/>
            <GradientStop Color="#4C8BB4" Offset="1"/>
        </LinearGradientBrush>
        <LinearGradientBrush x:Key="VerticalSliderThumbNormalBackground" EndPoint="1,0" StartPoint="0,0">
            <GradientStop Color="White" Offset="0"/>
            <GradientStop Color="#F0EFEF" Offset="0.4"/>
            <GradientStop Color="#D6D5D5" Offset=".8"/>
        </LinearGradientBrush>
        <Style x:Key="VerticalSliderLeftThumbStyle" TargetType="{x:Type Thumb}">
            <Setter Property="Focusable" Value="false"/>
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Setter Property="Height" Value="10"/>
            <Setter Property="Width" Value="18"/>
            <Setter Property="Foreground" Value="Gray"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Thumb}">
                        <Canvas SnapsToDevicePixels="true">
                            <Canvas.RenderTransform>
                                <TransformGroup>
                                    <TransformGroup.Children>
                                        <TransformCollection>
                                            <RotateTransform Angle="90"/>
                                            <TranslateTransform X="9" Y="5"/>
                                        </TransformCollection>
                                    </TransformGroup.Children>
                                </TransformGroup>
                            </Canvas.RenderTransform>
                            <Path x:Name="Background" Data="{StaticResource SliderPointedThumbOuterBorderGeometry}" Fill="{StaticResource VerticalSliderThumbNormalBackground}"/>
                            <Path x:Name="InnerBorder" Data="{StaticResource SliderPointedThumbMiddleBorderGeometry}" Stroke="White" StrokeThickness="1"/>
                            <Path x:Name="OuterBorder" Data="{StaticResource SliderPointedThumbOuterBorderGeometry}" Stroke="#FF929292" StrokeThickness="1"/>
                        </Canvas>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="true">
                                <Setter Property="Fill" TargetName="Background" Value="{StaticResource VerticalSliderThumbHoverBackground}"/>
                                <Setter Property="Stroke" TargetName="OuterBorder" Value="{StaticResource HorizontalSliderThumbHoverBorder}"/>
                            </Trigger>
                            <Trigger Property="Foreground" Value="Blue">
                                <Setter Property="Fill" TargetName="Background" Value="{StaticResource VerticalSliderThumbHoverBackground}"/>
                                <Setter Property="Stroke" TargetName="OuterBorder" Value="{StaticResource HorizontalSliderThumbHoverBorder}"/>
                            </Trigger>
                            <Trigger Property="IsDragging" Value="true">
                                <Setter Property="Fill" TargetName="Background" Value="{StaticResource VerticalSliderThumbPressedBackground}"/>
                                <Setter Property="Stroke" TargetName="OuterBorder" Value="{StaticResource HorizontalSliderThumbPressedBorder}"/>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter Property="Fill" TargetName="Background" Value="#FFF4F4F4"/>
                                <Setter Property="Stroke" TargetName="InnerBorder" Value="{x:Null}"/>
                                <Setter Property="Data" TargetName="OuterBorder" Value="{StaticResource SliderPointedThumbDisabledGeometry}"/>
                                <Setter Property="Stroke" TargetName="OuterBorder" Value="#FFAEB1AF"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <LinearGradientBrush x:Key="VerticalSliderThumbHoverBackgroundInverted" EndPoint="0,0" StartPoint="1,0">
            <GradientStop Color="white" Offset="0"/>
            <GradientStop Color="#B8E2F9" Offset="0.5"/>
            <GradientStop Color="#B0DFF8" Offset="1"/>
        </LinearGradientBrush>
        <LinearGradientBrush x:Key="VerticalSliderThumbPressedBackgroundInverted" EndPoint="0,0" StartPoint="1,0">
            <GradientStop Color="#B8E4FA" Offset="0.25"/>
            <GradientStop Color="#5EB4E3" Offset="0.5"/>
            <GradientStop Color="#4C8BB4" Offset="1"/>
        </LinearGradientBrush>
        <LinearGradientBrush x:Key="VerticalSliderThumbNormalBackgroundInverted" EndPoint="0,0" StartPoint="1,0">
            <GradientStop Color="White" Offset="0"/>
            <GradientStop Color="#F0EFEF" Offset="0.4"/>
            <GradientStop Color="#D6D5D5" Offset=".8"/>
        </LinearGradientBrush>
        <Style x:Key="VerticalSliderRightThumbStyle" TargetType="{x:Type Thumb}">
            <Setter Property="Focusable" Value="false"/>
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Setter Property="Height" Value="10"/>
            <Setter Property="Width" Value="18"/>
            <Setter Property="Foreground" Value="Gray"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Thumb}">
                        <Canvas SnapsToDevicePixels="true">
                            <Canvas.RenderTransform>
                                <TransformGroup>
                                    <TransformGroup.Children>
                                        <TransformCollection>
                                            <RotateTransform Angle="-90"/>
                                            <TranslateTransform X="9" Y="5"/>
                                        </TransformCollection>
                                    </TransformGroup.Children>
                                </TransformGroup>
                            </Canvas.RenderTransform>
                            <Path x:Name="Background" Data="{StaticResource SliderPointedThumbOuterBorderGeometry}" Fill="{StaticResource VerticalSliderThumbNormalBackgroundInverted}"/>
                            <Path x:Name="InnerBorder" Data="{StaticResource SliderPointedThumbMiddleBorderGeometry}" Stroke="White" StrokeThickness="1"/>
                            <Path x:Name="OuterBorder" Data="{StaticResource SliderPointedThumbOuterBorderGeometry}" Stroke="#FF929292" StrokeThickness="1"/>
                        </Canvas>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="true">
                                <Setter Property="Fill" TargetName="Background" Value="{StaticResource VerticalSliderThumbHoverBackgroundInverted}"/>
                                <Setter Property="Stroke" TargetName="OuterBorder" Value="{StaticResource HorizontalSliderThumbHoverBorder}"/>
                            </Trigger>
                            <Trigger Property="Foreground" Value="Blue">
                                <Setter Property="Fill" TargetName="Background" Value="{StaticResource VerticalSliderThumbHoverBackgroundInverted}"/>
                                <Setter Property="Stroke" TargetName="OuterBorder" Value="{StaticResource HorizontalSliderThumbHoverBorder}"/>
                            </Trigger>
                            <Trigger Property="IsDragging" Value="true">
                                <Setter Property="Fill" TargetName="Background" Value="{StaticResource VerticalSliderThumbPressedBackgroundInverted}"/>
                                <Setter Property="Stroke" TargetName="OuterBorder" Value="{StaticResource HorizontalSliderThumbPressedBorder}"/>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter Property="Fill" TargetName="Background" Value="#FFF4F4F4"/>
                                <Setter Property="Stroke" TargetName="InnerBorder" Value="{x:Null}"/>
                                <Setter Property="Data" TargetName="OuterBorder" Value="{StaticResource SliderPointedThumbDisabledGeometry}"/>
                                <Setter Property="Stroke" TargetName="OuterBorder" Value="#FFAEB1AF"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <LinearGradientBrush x:Key="VerticalSliderTrackNormalBorder" EndPoint="1,0" StartPoint="0,0">
            <GradientStop Color="#FFAEB1AF" Offset="0.1"/>
            <GradientStop Color="White" Offset=".9"/>
        </LinearGradientBrush>
        <Style x:Key="VerticalSliderThumbStyle" TargetType="{x:Type Thumb}">
            <Setter Property="Focusable" Value="false"/>
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Setter Property="Height" Value="11"/>
            <Setter Property="Width" Value="22"/>
            <Setter Property="Foreground" Value="Gray"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Thumb}">
                        <Canvas SnapsToDevicePixels="true">
                            <Canvas.RenderTransform>
                                <TransformGroup>
                                    <TransformGroup.Children>
                                        <TransformCollection>
                                            <RotateTransform Angle="90"/>
                                            <TranslateTransform X="11" Y="5.5"/>
                                        </TransformCollection>
                                    </TransformGroup.Children>
                                </TransformGroup>
                            </Canvas.RenderTransform>
                            <Path x:Name="Background" Data="{StaticResource SliderThumbOuterBorderGeometry}" Fill="{StaticResource VerticalSliderThumbNormalBackground}"/>
                            <Path x:Name="InnerBorder" Data="{StaticResource SliderThumbMiddleBorderGeometry}" Stroke="White" StrokeThickness="1"/>
                            <Path x:Name="OuterBorder" Data="{StaticResource SliderThumbOuterBorderGeometry}" Stroke="#FF929292" StrokeThickness="1"/>
                        </Canvas>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="true">
                                <Setter Property="Fill" TargetName="Background" Value="{StaticResource VerticalSliderThumbHoverBackground}"/>
                                <Setter Property="Stroke" TargetName="OuterBorder" Value="{StaticResource HorizontalSliderThumbHoverBorder}"/>
                            </Trigger>
                            <Trigger Property="Foreground" Value="Blue">
                                <Setter Property="Fill" TargetName="Background" Value="{StaticResource VerticalSliderThumbHoverBackground}"/>
                                <Setter Property="Stroke" TargetName="OuterBorder" Value="{StaticResource HorizontalSliderThumbHoverBorder}"/>
                            </Trigger>
                            <Trigger Property="IsDragging" Value="true">
                                <Setter Property="Fill" TargetName="Background" Value="{StaticResource VerticalSliderThumbPressedBackground}"/>
                                <Setter Property="Stroke" TargetName="OuterBorder" Value="{StaticResource HorizontalSliderThumbPressedBorder}"/>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter Property="Fill" TargetName="Background" Value="#FFF4F4F4"/>
                                <Setter Property="Stroke" TargetName="InnerBorder" Value="{x:Null}"/>
                                <Setter Property="Data" TargetName="OuterBorder" Value="{StaticResource SliderThumbDisabledGeometry}"/>
                                <Setter Property="Stroke" TargetName="OuterBorder" Value="#FFAEB1AF"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="GraySliderStyle" TargetType="{x:Type Slider}">
            <Setter Property="Stylus.IsPressAndHoldEnabled" Value="false"/>
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="Foreground" Value="#FFC4C4C4"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Slider}">
                        <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto" MinHeight="{TemplateBinding MinHeight}"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <TickBar x:Name="TopTick" Fill="{TemplateBinding Foreground}" Height="4" Placement="Top" Grid.Row="0" Visibility="Collapsed"/>
                                <TickBar x:Name="BottomTick" Fill="{TemplateBinding Foreground}" Height="4" Placement="Bottom" Grid.Row="2" Visibility="Collapsed"/>
                                <Border x:Name="TrackBackground" BorderBrush="{StaticResource HorizontalSliderTrackNormalBorder}" BorderThickness="1" CornerRadius="1" Height="4.0" Margin="5,0" Grid.Row="1" VerticalAlignment="center">
                                    <Border.Background>
                                        <SolidColorBrush Color="{DynamicResource ApplicationBackgroundColor}"/>
                                    </Border.Background>
                                    <Canvas Margin="-6,-1">
                                        <Canvas.RenderTransform>
                                            <ScaleTransform ScaleX="0.7" ScaleY="0.7"></ScaleTransform>
                                        </Canvas.RenderTransform>
                                        <Rectangle x:Name="PART_SelectionRange" Fill="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" Height="4.0" Stroke="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}" StrokeThickness="1.0" Visibility="Hidden"/>
                                    </Canvas>
                                </Border>
                                <Track x:Name="PART_Track" Grid.Row="1">
                                    <Track.DecreaseRepeatButton>
                                        <RepeatButton Command="{x:Static Slider.DecreaseLarge}" Style="{StaticResource SliderRepeatButtonStyle}"/>
                                    </Track.DecreaseRepeatButton>
                                    <Track.IncreaseRepeatButton>
                                        <RepeatButton Command="{x:Static Slider.IncreaseLarge}" Style="{StaticResource SliderRepeatButtonStyle}"/>
                                    </Track.IncreaseRepeatButton>
                                    <Track.Thumb>
                                        <Thumb x:Name="Thumb" Style="{StaticResource HorizontalSliderThumbStyle}"/>
                                    </Track.Thumb>
                                </Track>
                            </Grid>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="TickPlacement" Value="TopLeft">
                                <Setter Property="Visibility" TargetName="TopTick" Value="Visible"/>
                                <Setter Property="Style" TargetName="Thumb" Value="{StaticResource HorizontalSliderUpThumbStyle}"/>
                                <Setter Property="Margin" TargetName="TrackBackground" Value="5,2,5,0"/>
                            </Trigger>
                            <Trigger Property="TickPlacement" Value="BottomRight">
                                <Setter Property="Visibility" TargetName="BottomTick" Value="Visible"/>
                                <Setter Property="Style" TargetName="Thumb" Value="{StaticResource HorizontalSliderDownThumbStyle}"/>
                                <Setter Property="Margin" TargetName="TrackBackground" Value="5,0,5,2"/>
                            </Trigger>
                            <Trigger Property="TickPlacement" Value="Both">
                                <Setter Property="Visibility" TargetName="TopTick" Value="Visible"/>
                                <Setter Property="Visibility" TargetName="BottomTick" Value="Visible"/>
                            </Trigger>
                            <Trigger Property="IsSelectionRangeEnabled" Value="true">
                                <Setter Property="Visibility" TargetName="PART_SelectionRange" Value="Visible"/>
                            </Trigger>
                            <Trigger Property="IsKeyboardFocused" Value="true">
                                <Setter Property="Foreground" TargetName="Thumb" Value="Blue"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Style.Triggers>
                <Trigger Property="Orientation" Value="Vertical">
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="{x:Type Slider}">
                                <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto"/>
                                            <ColumnDefinition MinWidth="{TemplateBinding MinWidth}" Width="Auto"/>
                                            <ColumnDefinition Width="Auto"/>
                                        </Grid.ColumnDefinitions>
                                        <TickBar x:Name="TopTick" Grid.Column="0" Fill="{TemplateBinding Foreground}" Placement="Left" Visibility="Collapsed" Width="4"/>
                                        <TickBar x:Name="BottomTick" Grid.Column="2" Fill="{TemplateBinding Foreground}" Placement="Right" Visibility="Collapsed" Width="4"/>
                                        <Border x:Name="TrackBackground" BorderBrush="{StaticResource VerticalSliderTrackNormalBorder}" BorderThickness="1" Background="{StaticResource HorizontalSliderTrackNormalBackground}" Grid.Column="1" CornerRadius="1" HorizontalAlignment="center" Margin="0,5" Width="4.0">
                                            <Canvas Margin="-1,-6">
                                                <Rectangle x:Name="PART_SelectionRange" Fill="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" Stroke="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}" StrokeThickness="1.0" Visibility="Hidden" Width="4.0"/>
                                            </Canvas>
                                        </Border>
                                        <Track x:Name="PART_Track" Grid.Column="1">
                                            <Track.DecreaseRepeatButton>
                                                <RepeatButton Command="{x:Static Slider.DecreaseLarge}" Style="{StaticResource SliderRepeatButtonStyle}"/>
                                            </Track.DecreaseRepeatButton>
                                            <Track.IncreaseRepeatButton>
                                                <RepeatButton Command="{x:Static Slider.IncreaseLarge}" Style="{StaticResource SliderRepeatButtonStyle}"/>
                                            </Track.IncreaseRepeatButton>
                                            <Track.Thumb>
                                                <Thumb x:Name="Thumb" Style="{StaticResource VerticalSliderThumbStyle}"/>
                                            </Track.Thumb>
                                        </Track>
                                    </Grid>
                                </Border>
                                <ControlTemplate.Triggers>
                                    <Trigger Property="TickPlacement" Value="TopLeft">
                                        <Setter Property="Visibility" TargetName="TopTick" Value="Visible"/>
                                        <Setter Property="Style" TargetName="Thumb" Value="{StaticResource VerticalSliderLeftThumbStyle}"/>
                                        <Setter Property="Margin" TargetName="TrackBackground" Value="2,5,0,5"/>
                                    </Trigger>
                                    <Trigger Property="TickPlacement" Value="BottomRight">
                                        <Setter Property="Visibility" TargetName="BottomTick" Value="Visible"/>
                                        <Setter Property="Style" TargetName="Thumb" Value="{StaticResource VerticalSliderRightThumbStyle}"/>
                                        <Setter Property="Margin" TargetName="TrackBackground" Value="0,5,2,5"/>
                                    </Trigger>
                                    <Trigger Property="TickPlacement" Value="Both">
                                        <Setter Property="Visibility" TargetName="TopTick" Value="Visible"/>
                                        <Setter Property="Visibility" TargetName="BottomTick" Value="Visible"/>
                                    </Trigger>
                                    <Trigger Property="IsSelectionRangeEnabled" Value="true">
                                        <Setter Property="Visibility" TargetName="PART_SelectionRange" Value="Visible"/>
                                    </Trigger>
                                    <Trigger Property="IsKeyboardFocused" Value="true">
                                        <Setter Property="Foreground" TargetName="Thumb" Value="Blue"/>
                                    </Trigger>
                                </ControlTemplate.Triggers>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Trigger>
            </Style.Triggers>
        </Style>
        <Style x:Key="ListBoxItemStyle" TargetType="{x:Type ListBoxItem}">
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
            <Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
            <Setter Property="Padding" Value="2,0,0,0"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ListBoxItem}">
                        <Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
                            <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsSelected" Value="true">
                                <Setter Property="BorderBrush" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
                                <Setter Property="BorderThickness" TargetName="Bd" Value="3"/>
                                <Setter Property="CornerRadius" TargetName="Bd" Value="5"/>
                                <Setter Property="Background" TargetName="Bd" Value="{x:Null}"></Setter>
                                <!--<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>-->
                                <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
                            </Trigger>
                            <MultiTrigger>
                                <MultiTrigger.Conditions>
                                    <Condition Property="IsSelected" Value="true"/>
                                    <Condition Property="Selector.IsSelectionActive" Value="false"/>
                                </MultiTrigger.Conditions>
                                <Setter Property="BorderBrush" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
                                <Setter Property="BorderThickness" TargetName="Bd" Value="3"/>
                                <Setter Property="CornerRadius" TargetName="Bd" Value="5"/>
                                <Setter Property="Background" TargetName="Bd" Value="{x:Null}"></Setter>
                                <!--<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>-->
                                <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
                            </MultiTrigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="HotspotButtonStyle" TargetType="{x:Type Button}">
            <Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
            <Setter Property="Background" Value="{x:Null}"/>
            <Setter Property="BorderBrush" Value="Gray"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
            <Setter Property="HorizontalContentAlignment" Value="Center"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="Padding" Value="1"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <Microsoft_Windows_Themes:ButtonChrome x:Name="Chrome" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderPressed="{TemplateBinding IsPressed}" RenderDefaulted="{TemplateBinding IsDefaulted}" SnapsToDevicePixels="true">
                            <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </Microsoft_Windows_Themes:ButtonChrome>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsKeyboardFocused" Value="true">
                                <Setter Property="RenderDefaulted" TargetName="Chrome" Value="true"/>
                            </Trigger>
                            <Trigger Property="ToggleButton.IsChecked" Value="true">
                                <Setter Property="RenderPressed" TargetName="Chrome" Value="true"/>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter Property="Foreground" Value="#ADADAD"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Application.Resources>
</Application>
